<?php include_once("../../../configuracion/config.php");
$operacion ="Personal > Actualizar contrase&ntilde;a"
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/plantillaAdmin.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>Cambiar contrase&ntilde;a ....</title>
<!-- InstanceEndEditable -->
<link rel="stylesheet" type="text/css" href="../../css/estilo.css"/>
<link rel="SHORTCUT ICON" href="../../../logo/unc.ico"/>
<!-- InstanceBeginEditable name="head" -->

<link rel="stylesheet" type="text/css" href="../../css/DatePicker.css"/>

<script type="text/javascript" src="../../js/mootools.js"></script>
<script type="text/javascript" src="../../js/fValidator-full.js"></script>
<script type="text/javascript" src="../../js/md5.js"></script>
<script>
window.addEvent('domready', function(){
			 var myValidator = new fValidator("flogin");

			$('flogin').addEvent('submit', function(e) {
				/**
				 * Prevent the submit event
				 */
				new Event(e).stop();
				if(myValidator.result){ /*Si las restricciones de los campos se cumplen*/
					 sinMD5= $('pass').value;
					$('pass').value = hex_md5(sinMD5);
					if($('nuevaC').value==$('confC').value){
							sinMD5 = $('nuevaC').value;
							$('nuevaC').value = hex_md5(sinMD5);
							$('confC').value = hex_md5(sinMD5);
							var log = $('log_res_ajax').empty().addClass('ajax-loading');
							this.send({
								update: log,
								onComplete: function() {
									log.removeClass('ajax-loading');
								}
							});
					  }else{ 
					  		alert('Las contraseñas nuevas no coinciden');
					  		$('pass').value ="";
					  
					  }//si las nuevas coinciden
				}
			});
		}); 

window.addEvent('domready', function(){
	 //new Event(ev).stop();
	 //Enviamos una peticion a recibe.php	
	 var miJSON = new Json.Remote("ajax.form/login_datos.php",	{
 					//la peticion nos devolvera un objeto el cual llegara como parametro en el evento onComplete
 			onComplete: function(objeto){
					$('usuario').value = objeto.usuario;
					$('usuario').readOnly=true;
					$('pass').value =="";
				
		  }
	});	
	miJSON.send();
	}
);
</script>

<!-- InstanceEndEditable -->

</head>

<body>

<?php include('../estructura/encabezado.php');?>
<div class="menuIzqquierdo">

<?php include('../menu/menuIzq.html');?>

</div>
<div class="content"><!-- InstanceBeginEditable name="EditRegion3" -->
<form id="flogin" name="flogin" method="post" action="ajax.form/login_edit.php" >
<div id="ajax_bar">
<span class="operacion"><?php echo $operacion; ?></span>	
<img  src="../../img/pass128x128.png"name="foto" width="128" height="128"align="right" id="foto" title="Imagen Integrante"  />
	 <br /> <?php include_once("int_login.php");?>		

	 <label for="nuevaC">Nueva contraseña:
	<input name="nuevaC" type="password" id="nuevaC" size="30" />
	</label>
	<label for="confC">confirma  contraseña:
	<input name="confC" type="password" id="confC" size="30" />
	</label> 
		<br clear="right" /><input id="submitter" class="fValidator-form right" type="submit" value="Actualizar" name="guardar"/>
	

</div>
<div id="info">

		<div id="log_res_ajax"><!-- spanner --><?php 
		$idpersona = $_SESSION['INTEGRANTE'];
		include_once("../../info/integrante.php");?></div>
</div>
</form>
<p>&nbsp;</p>
<!-- InstanceEndEditable --></div>
<?php include('../estructura/pie.php');?>
</body>
<!-- InstanceEnd --></html>
 